<!DOCTYPE HTML>
<html lang="en">
	<head>
		<meta charset="utf-8">
		<title>Demo: Dijit Buttons</title>
		<link rel="stylesheet" href="css/demo.css" media="screen">
		<link rel="stylesheet" href="js/dijit/themes/claro/claro.css" media="screen">
	</head>
	<body class="claro">
		<h1>Demo: dijit/form/Classy</h1>
		
		<!-- load dojo and provide config via data attribute -->
		<script src="js/dojo/dojo.js" data-dojo-config="isDebug: true, async: true"></script>
		<script>
		
			require(["dojo/_base/declare", "dojo/domReady!"], function(declare) {
				
				var A = declare(null, {
					// A few properties...
					propertyA: "Yes",
					propertyB: 2
				});
				 
				// Define class B
				var B = declare(A, {
					// A few properties...
					propertyA: "Maybe",
					propertyB: 1,
					propertyC: true
				});
				 
				// Define class C
				var C = declare([A, B], {
					// A few properties...
					propertyA: "No",
					propertyB: 99,
					propertyD: false
				});
				
				var D = declare([C, A], {
					
				});
				
				
				var instance = new C();
				
				
				console.log(instance.propertyA);// overridden by B, then by C
				console.log(instance.propertyB);/// instance.propertyB = 99 // overridden by B, then by C
				console.log(instance.propertyC);/// instance.propertyC = true // kept from B
				console.log(instance.propertyD);/// instance.propertyD = false // created by C
				
				console.log("-------------------------------");
				var d = new D();
				
				console.log(d instanceof A);
				console.log(d instanceof B);
				console.log(d instanceof C);
	
				
				console.log(d.isInstanceOf(A)); 
				console.log(d.isInstanceOf(B)); 
				console.log(d.isInstanceOf(C)); 
				
			});
		</script>
	</body>
</html>